const messageBox = new MessageBox({ root: '.tips', content: 'span' });
const form = document.querySelector('form');

// 图片选择框初始化
if (document.location.pathname.includes('/book/')) {
	FormUtils.imageInputInit();
}

// 阻止表单默认提交事件
form.onsubmit = function(event) {
	if (!form.name.value.trim() || !form.author.value.trim()) {
		messageBox.show("书名或作者不能为空");
		event.preventDefault();
	}
}